package com.example.myapplication.ui.activity.coins

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.myapplication.request.CoinsRequest
import kotlinx.coroutines.launch

/**
 *积分排序的viewModel
 *
 * @author : Kun
 * @date : 2021/6/11
 * @time : 10:52
 */
class RankViewModel : ViewModel() {

    /**
     * 积分相关的请求
     */
    val coinsRequest = CoinsRequest()

    /**
     *请求积分排行
     */
    fun requestRankListResult(index: Int) {
        viewModelScope.launch {
            coinsRequest.requestRankListResult(index)
        }
    }
}